package com.blb.proxy;

/**
 * @author lvtian
 * @date 2022/12/28 9:12
 * 代理对象 手机门店
 */
public class CellphoneShop implements CellphoneSale{
    //被代理对象 依赖倒置原则(依赖更抽象的类型)
    private CellphoneSale factory;
    //通过构造方法传递一个被代理对象
    public CellphoneShop(CellphoneSale factory) {
        this.factory = factory;
    }

    @Override
    public void sellCellPhone(String brand) {
        System.out.println("介绍手机...");
        //调用被代理对象的方法
        factory.sellCellPhone(brand);
        System.out.println("维修售后");
    }
}
